<?php
class controllerPT extends Controller {
	public function Buku_con()
	{
		parent::__construct();
		$this->load->model('buku_model');
		$this->load->library('pagination'); //call pagination library
}
	function getPertanyaan() {
//count the total rows of tb_book
		$this->db->select('*');
		$this->db->from('kuesioner');
		$getData = $this->db->get('');
		
		$a = $getData->num_rows();
		
		//$config['base_url'] = base_url().'index.php/Buku_con/getBuku/'; //set the base url for pagination
		$config['total_rows'] = $a; //total rows
		$config['per_page'] = '2'; //the number of per page for pagination
		$config['uri_segment'] = 3; //see from base_url. 3 for this case
		$config['full_tag_open'] = '<p>';
		$config['full_tag_close'] = '</p>';
		$this->pagination->initialize($config); //initialize pagination
		$data['title'] = 'menampilkan isi buku';
		$data['detail'] = $this->buku_model->getBuku($config['per_page'],$this->uri->segment(3));
		$this->load->view('buku_view', $data);
	}
}

?>